Optimal. Leaf size=187 \[ \frac {3}{2} b \left (2 a^2-b^2\right ) x-\frac {3 a \left (a^2-12 b^2\right ) \tanh ^{-1}(\cos (c+d x))}{8 d}-\frac {b^2 \left (73 a^2-2 b^2\right ) \cos (c+d x)}{8 a d}-\frac {13 b^3 \cos (c+d x) \sin (c+d x)}{4 d}+\frac {17 b \cot (c+d x) (a+b \sin (c+d x))^2}{8 d}+\frac {5 \cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^3}{8 d}-\frac {\cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^4}{4 a d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.43, antiderivative size = 187, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {2972, 3126,
3112, 3102, 2814, 3855} \begin {gather*} -\frac {b^2 \left (73 a^2-2 b^2\right ) \cos (c+d x)}{8 a d}-\frac {3 a \left (a^2-12 b^2\right ) \tanh ^{-1}(\cos (c+d x))}{8 d}+\frac {3}{2} b x \left (2 a^2-b^2\right )+\frac {17 b \cot (c+d x) (a+b \sin (c+d x))^2}{8 d}-\frac {\cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^4}{4 a d}+\frac {5 \cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^3}{8 d}-\frac {13 b^3 \sin (c+d x) \cos (c+d x)}{4 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2814
Rule 2972
Rule 3102
Rule 3112
Rule 3126
Rule 3855
Rubi steps
\begin {align*} \int \cot ^4(c+d x) \csc (c+d x) (a+b \sin (c+d x))^3 \, dx &=-\frac {\cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^4}{4 a d}-\frac {\int \csc ^3(c+d x) (a+b \sin (c+d x))^3 \left (15 a^2+3 a b \sin (c+d x)-12 a^2 \sin ^2(c+d x)\right ) \, dx}{12 a^2}\\ &=\frac {5 \cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^3}{8 d}-\frac {\cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^4}{4 a d}-\frac {\int \csc ^2(c+d x) (a+b \sin (c+d x))^2 \left (51 a^2 b-3 a \left (3 a^2-2 b^2\right ) \sin (c+d x)-54 a^2 b \sin ^2(c+d x)\right ) \, dx}{24 a^2}\\ &=\frac {17 b \cot (c+d x) (a+b \sin (c+d x))^2}{8 d}+\frac {5 \cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^3}{8 d}-\frac {\cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^4}{4 a d}-\frac {\int \csc (c+d x) (a+b \sin (c+d x)) \left (-9 a^2 \left (a^2-12 b^2\right )-3 a b \left (21 a^2-2 b^2\right ) \sin (c+d x)-156 a^2 b^2 \sin ^2(c+d x)\right ) \, dx}{24 a^2}\\ &=-\frac {13 b^3 \cos (c+d x) \sin (c+d x)}{4 d}+\frac {17 b \cot (c+d x) (a+b \sin (c+d x))^2}{8 d}+\frac {5 \cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^3}{8 d}-\frac {\cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^4}{4 a d}-\frac {\int \csc (c+d x) \left (-18 a^3 \left (a^2-12 b^2\right )-72 a^2 b \left (2 a^2-b^2\right ) \sin (c+d x)-6 a b^2 \left (73 a^2-2 b^2\right ) \sin ^2(c+d x)\right ) \, dx}{48 a^2}\\ &=-\frac {b^2 \left (73 a^2-2 b^2\right ) \cos (c+d x)}{8 a d}-\frac {13 b^3 \cos (c+d x) \sin (c+d x)}{4 d}+\frac {17 b \cot (c+d x) (a+b \sin (c+d x))^2}{8 d}+\frac {5 \cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^3}{8 d}-\frac {\cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^4}{4 a d}-\frac {\int \csc (c+d x) \left (-18 a^3 \left (a^2-12 b^2\right )-72 a^2 b \left (2 a^2-b^2\right ) \sin (c+d x)\right ) \, dx}{48 a^2}\\ &=\frac {3}{2} b \left (2 a^2-b^2\right ) x-\frac {b^2 \left (73 a^2-2 b^2\right ) \cos (c+d x)}{8 a d}-\frac {13 b^3 \cos (c+d x) \sin (c+d x)}{4 d}+\frac {17 b \cot (c+d x) (a+b \sin (c+d x))^2}{8 d}+\frac {5 \cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^3}{8 d}-\frac {\cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^4}{4 a d}+\frac {1}{8} \left (3 a \left (a^2-12 b^2\right )\right ) \int \csc (c+d x) \, dx\\ &=\frac {3}{2} b \left (2 a^2-b^2\right ) x-\frac {3 a \left (a^2-12 b^2\right ) \tanh ^{-1}(\cos (c+d x))}{8 d}-\frac {b^2 \left (73 a^2-2 b^2\right ) \cos (c+d x)}{8 a d}-\frac {13 b^3 \cos (c+d x) \sin (c+d x)}{4 d}+\frac {17 b \cot (c+d x) (a+b \sin (c+d x))^2}{8 d}+\frac {5 \cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^3}{8 d}-\frac {\cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^4}{4 a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(381\) vs. \(2(187)=374\).
time = 6.25, size = 381, normalized size = 2.04 \begin {gather*} -\frac {3 b \left (-2 a^2+b^2\right ) (c+d x)}{2 d}-\frac {3 a b^2 \cos (c+d x)}{d}+\frac {\left (4 a^2 b \cos \left (\frac {1}{2} (c+d x)\right )-b^3 \cos \left (\frac {1}{2} (c+d x)\right )\right ) \csc \left (\frac {1}{2} (c+d x)\right )}{2 d}+\frac {\left (5 a^3-12 a b^2\right ) \csc ^2\left (\frac {1}{2} (c+d x)\right )}{32 d}-\frac {a^2 b \cot \left (\frac {1}{2} (c+d x)\right ) \csc ^2\left (\frac {1}{2} (c+d x)\right )}{8 d}-\frac {a^3 \csc ^4\left (\frac {1}{2} (c+d x)\right )}{64 d}-\frac {3 \left (a^3-12 a b^2\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{8 d}+\frac {3 \left (a^3-12 a b^2\right ) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{8 d}+\frac {\left (-5 a^3+12 a b^2\right ) \sec ^2\left (\frac {1}{2} (c+d x)\right )}{32 d}+\frac {a^3 \sec ^4\left (\frac {1}{2} (c+d x)\right )}{64 d}+\frac {\sec \left (\frac {1}{2} (c+d x)\right ) \left (-4 a^2 b \sin \left (\frac {1}{2} (c+d x)\right )+b^3 \sin \left (\frac {1}{2} (c+d x)\right )\right )}{2 d}-\frac {b^3 \sin (2 (c+d x))}{4 d}+\frac {a^2 b \sec ^2\left (\frac {1}{2} (c+d x)\right ) \tan \left (\frac {1}{2} (c+d x)\right )}{8 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.28, size = 226, normalized size = 1.21 Too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.49, size = 212, normalized size = 1.13 \begin {gather*} \frac {16 \, {\left (3 \, d x + 3 \, c + \frac {3 \, \tan \left (d x + c\right )^{2} - 1}{\tan \left (d x + c\right )^{3}}\right )} a^{2} b - 8 \, {\left (3 \, d x + 3 \, c + \frac {3 \, \tan \left (d x + c\right )^{2} + 2}{\tan \left (d x + c\right )^{3} + \tan \left (d x + c\right )}\right )} b^{3} - a^{3} {\left (\frac {2 \, {\left (5 \, \cos \left (d x + c\right )^{3} - 3 \, \cos \left (d x + c\right )\right )}}{\cos \left (d x + c\right )^{4} - 2 \, \cos \left (d x + c\right )^{2} + 1} + 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) - 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )} + 12 \, a b^{2} {\left (\frac {2 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} - 4 \, \cos \left (d x + c\right ) + 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) - 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{16 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 331, normalized size = 1.77 \begin {gather*} -\frac {48 \, a b^{2} \cos \left (d x + c\right )^{5} - 24 \, {\left (2 \, a^{2} b - b^{3}\right )} d x \cos \left (d x + c\right )^{4} + 48 \, {\left (2 \, a^{2} b - b^{3}\right )} d x \cos \left (d x + c\right )^{2} + 10 \, {\left (a^{3} - 12 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} - 24 \, {\left (2 \, a^{2} b - b^{3}\right )} d x - 6 \, {\left (a^{3} - 12 \, a b^{2}\right )} \cos \left (d x + c\right ) + 3 \, {\left ({\left (a^{3} - 12 \, a b^{2}\right )} \cos \left (d x + c\right )^{4} + a^{3} - 12 \, a b^{2} - 2 \, {\left (a^{3} - 12 \, a b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 3 \, {\left ({\left (a^{3} - 12 \, a b^{2}\right )} \cos \left (d x + c\right )^{4} + a^{3} - 12 \, a b^{2} - 2 \, {\left (a^{3} - 12 \, a b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 8 \, {\left (b^{3} \cos \left (d x + c\right )^{5} + 4 \, {\left (2 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{3} - 3 \, {\left (2 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{16 \, {\left (d \cos \left (d x + c\right )^{4} - 2 \, d \cos \left (d x + c\right )^{2} + d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.57, size = 343, normalized size = 1.83 \begin {gather*} \frac {a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 8 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 8 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 24 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 120 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 32 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 96 \, {\left (2 \, a^{2} b - b^{3}\right )} {\left (d x + c\right )} + 24 \, {\left (a^{3} - 12 \, a b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + \frac {64 \, {\left (b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 6 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 6 \, a b^{2}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2}} - \frac {50 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 600 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 120 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 32 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 8 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 24 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 8 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a^{3}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4}}}{64 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 9.50, size = 699, normalized size = 3.74 \begin {gather*} \frac {a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{64\,d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {3\,a\,b^2}{8}-\frac {a^3}{8}\right )}{d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (6\,a\,b^2-\frac {3\,a^3}{2}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (102\,a\,b^2-2\,a^3\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (108\,a\,b^2-\frac {15\,a^3}{4}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (26\,a^2\,b-8\,b^3\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (30\,a^2\,b+8\,b^3\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (58\,a^2\,b-32\,b^3\right )+\frac {a^3}{4}+2\,a^2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (16\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+32\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+16\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\right )}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {15\,a^2\,b}{8}-\frac {b^3}{2}\right )}{d}+\frac {3\,a\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (a^2-12\,b^2\right )}{8\,d}+\frac {a^2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{8\,d}-\frac {3\,b\,\mathrm {atan}\left (\frac {\frac {3\,b\,\left (2\,a^2-b^2\right )\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (9\,a\,b^2-\frac {3\,a^3}{4}\right )-6\,a^2\,b+3\,b^3-b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (2\,a^2-b^2\right )\,9{}\mathrm {i}\right )}{2}+\frac {3\,b\,\left (2\,a^2-b^2\right )\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (9\,a\,b^2-\frac {3\,a^3}{4}\right )-6\,a^2\,b+3\,b^3+b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (2\,a^2-b^2\right )\,9{}\mathrm {i}\right )}{2}}{2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (36\,a^4\,b^2-36\,a^2\,b^4+9\,b^6\right )+27\,a\,b^5+\frac {9\,a^5\,b}{2}-\frac {225\,a^3\,b^3}{4}-\frac {b\,\left (2\,a^2-b^2\right )\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (9\,a\,b^2-\frac {3\,a^3}{4}\right )-6\,a^2\,b+3\,b^3-b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (2\,a^2-b^2\right )\,9{}\mathrm {i}\right )\,3{}\mathrm {i}}{2}+\frac {b\,\left (2\,a^2-b^2\right )\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (9\,a\,b^2-\frac {3\,a^3}{4}\right )-6\,a^2\,b+3\,b^3+b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (2\,a^2-b^2\right )\,9{}\mathrm {i}\right )\,3{}\mathrm {i}}{2}}\right )\,\left (2\,a^2-b^2\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________